feat(panel): implement permissions system for panel#250
Merged
Akinator31 merged 3 commits intomainfrom Nov 24, 2025
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to the ticket bot API and permission handling in the Rustmail project. The main focus is on adding user session and permission checks, optimizing permission lookups with caching, and improving the handling of scheduled ticket closures. These changes enhance security by ensuring only authorized users can view or interact with tickets, and improve performance by reducing redundant permission queries.
Authentication and Permission Checks:
handle_tickets_botendpoint, requiring a validsession_idcookie and verifying user permissions before returning ticket data. Only admins or users with the required category permissions can view tickets.Permission Caching and Utilities:
permissions_cachemodule using themokacrate for efficient, time-limited caching of admin status and category permissions, reducing redundant Discord API calls.Ticket Closure Improvements:
format_durationhelper to consistently format human-readable durations for ticket closures and warnings.Code Quality and Refactoring:
Dependency Updates:
mokacrate toCargo.tomlfor caching support.These changes collectively improve both the security and performance of the ticket bot API, providing a better user experience and more robust permission management.